package com.wtwd.wtwddevice.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wtwd.wtwddevice.mapper.FrequencyMapper;
import com.wtwd.wtwddevice.model.entity.Frequency;
import com.wtwd.wtwddevice.service.IFrequencyService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author mjy
 * @since 2024-05-21
 */
@Service
public class FrequencyServiceImpl extends ServiceImpl<FrequencyMapper, Frequency> implements IFrequencyService {


    @Resource
    private FrequencyMapper frequencyMapper;


    @Override
    public boolean insertOrUpdate(Frequency frequency) {
        if (frequency == null) {
            return false;
        }
        return frequencyMapper.insertOrUpdate(frequency) > 0 ? true : false;
    }

    @Override
    public boolean updateState(Long deviceId, int type, int state) {
        return frequencyMapper.updateState(deviceId, type, state) > 0 ? true : false;
    }
}
